﻿using System.Diagnostics;

public class Logcat
{
    public enum Tag
    {
        none,
        all,
        log,
        warning,
        error,
    }
    [Conditional("ENABLE_LOG")]
    public static void log(string content, Tag lvl = Tag.log)
    {
        if(GameSetting.Instance.LogTag == Tag.none)
        {
            return;
        }
        if(GameSetting.Instance.LogTag != Tag.all && GameSetting.Instance.LogTag != lvl)
        {
            return;
        }
        string str = "<color=#0000ff>[SelfLog-"+lvl.ToString()+"]: </color>";
        UnityEngine.Debug.Log(str + content);
    }
    [Conditional("ENABLE_LOG")]
    public static void warning(string content, Tag lvl = Tag.warning)
    {
        if(GameSetting.Instance.LogTag == Tag.none)
        {
            return;
        }
        if(GameSetting.Instance.LogTag != Tag.all && GameSetting.Instance.LogTag != lvl)
        {
            return;
        }
        string str = "<color=#0000ff>[SelfLog-"+lvl.ToString()+"]: </color>";
        UnityEngine.Debug.LogWarning(str + content);
    }
    [Conditional("ENABLE_LOG")]
    public static void error(string content, Tag lvl = Tag.error)
    {
        if(GameSetting.Instance.LogTag == Tag.none)
        {
            return;
        }
        if(GameSetting.Instance.LogTag != Tag.all && GameSetting.Instance.LogTag != lvl)
        {
            return;
        }
        UnityEngine.Debug.LogError(content);
    }
    public static void assert(string content)
    {
        UnityEngine.Debug.LogError(content);
    }
}
